﻿<Fluent:RibbonWindow x:Class="ArchX.MainView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:avalonDock="http://schemas.xceed.com/wpf/xaml/avalondock"
		xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
		xmlns:Views="clr-namespace:ArchX.Views"
		xmlns:Selectors="clr-namespace:ArchX.Components.Selectors"
		xmlns:Converters="clr-namespace:ArchX.Components.Converters"
        Title="Arch-X" Height="350" Width="525">
    <Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>

		<Views:RibbonView DataContext="{Binding Path=.}"/>
		<!--#################################################################################################-->
		<!--CONTENT-->

		<avalonDock:DockingManager x:Name="dockManager" Grid.Row="1"
				AnchorablesSource="{Binding Tools}"  
				DocumentsSource="{Binding Documents}"
				ActiveContent="{Binding ActiveDocument, Mode=TwoWay, Converter={x:Static Converters:ActiveDocumentConverter.Instance}}" >

			<avalonDock:DockingManager.Theme>
				<avalonDock:AeroTheme/>
			</avalonDock:DockingManager.Theme>

			<avalonDock:DockingManager.LayoutItemContainerStyleSelector>
				<Selectors:PanesStyleSelector>
					<Selectors:PanesStyleSelector.ToolStyle>
						<Style TargetType="{x:Type avalonDock:LayoutAnchorableItem}">
							<Setter Property="Title" Value="{Binding Model.DisplayName}"/>
							<Setter Property="IconSource" Value="{Binding Model.Icon}"/>
							<Setter Property="Visibility" Value="{Binding Model.IsVisible, Mode=TwoWay, Converter={x:Static Converters:BoolToVisibilityConverter.Instance}, ConverterParameter={x:Static Visibility.Hidden}}"/>
							<Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
							<Setter Property="IsSelected" Value="{Binding Model.IsSelected, Mode=TwoWay}"/>
							<Setter Property="IsActive" Value="{Binding Model.IsActive, Mode=TwoWay}"/>
						</Style>
					</Selectors:PanesStyleSelector.ToolStyle>
					<Selectors:PanesStyleSelector.DocumentStyle>
						<Style TargetType="{x:Type avalonDock:LayoutItem}">
							<Setter Property="Title" Value="{Binding Model.DisplayName}"/>
							<Setter Property="ToolTip" Value="{Binding Model.DisplayName}"/>
							<Setter Property="CloseCommand" Value="{Binding Model.CloseCommand}"/>
							<Setter Property="IconSource" Value="{Binding Model.Icon}"/>
							<Setter Property="ContentId" Value="{Binding Model.ContentId}"/>
							<Setter Property="IsSelected" Value="{Binding Model.IsSelected, Mode=TwoWay}"/>
						</Style>
					</Selectors:PanesStyleSelector.DocumentStyle>
				</Selectors:PanesStyleSelector>
			</avalonDock:DockingManager.LayoutItemContainerStyleSelector>

			<avalonDock:LayoutRoot>
				<avalonDock:LayoutPanel Orientation="Horizontal">

					<avalonDock:LayoutDocumentPane/>
					
					<avalonDock:LayoutAnchorablePane DockWidth="250">
						<avalonDock:LayoutAnchorable Title="Layers">
							<Views:LayerPaneView DataContext="{Binding ActiveDocument}" />
						</avalonDock:LayoutAnchorable>
					</avalonDock:LayoutAnchorablePane>

				</avalonDock:LayoutPanel>
			</avalonDock:LayoutRoot>
		</avalonDock:DockingManager>

		<Fluent:StatusBar HorizontalAlignment="Stretch" Height="25" VerticalAlignment="Bottom" Grid.Row="2">
			<Fluent:StatusBarItem Title="Position"
                                  Value="{Binding ActiveDocument.CurrentPosition}"
                                  HorizontalAlignment="Left">
			</Fluent:StatusBarItem>
			<Separator HorizontalAlignment="Left" />
			<Fluent:StatusBarItem Title="Selected Words"
                                  Value="15"
                                  ToolTip="This is Selected Words"
                                  Content="15"
                                  HorizontalAlignment="Left" />
			<Separator HorizontalAlignment="Left" />
			<Fluent:StatusBarItem Title="Zoom"
                                  HorizontalAlignment="Right"
                                  Value="{Binding Value, ElementName=zoomSlider, StringFormat={}{0:0}\%}" />
			<Fluent:StatusBarItem Title="Zoom Slider"
                                  HorizontalAlignment="Right">
				<Slider x:Name="zoomSlider"
                        Minimum="20"
                        Maximum="500"
                        IsDirectionReversed="False"
                        Style="{DynamicResource ZoomSliderStyle}"
                        Value="100" />
			</Fluent:StatusBarItem>
		</Fluent:StatusBar>
	</Grid>
</Fluent:RibbonWindow>
